package model;

import javax.swing.text.JTextComponent;


/**
 * Sends notifications to user via prompt.
 * 
 * @author Troy Ferrell
 *
 */

public class NotifyPicassa 
{
	public static JTextComponent prompt;
	public static final String SYNTAX_ERROR = "incorrect syntax";
	public static final String ARGUMENTS_ERROR = "incorrect arguments";
	
	public static void setPrompt(JTextComponent newPrompt)
	{
		if(newPrompt != null)
			prompt = newPrompt;
	}
	
	public static void showError(String errorMessage)
	{
		if(prompt != null && errorMessage != null)
			prompt.setText( prompt.getText() + "\nERROR: " + errorMessage );
	}
	
	public static void showNotification(String updateStr)
	{
		if(prompt != null  && updateStr != null)
			prompt.setText( prompt.getText() + "\nSYSTEM: " + updateStr );
	}
}
